package com.dapeng.jackson.annotations;

import com.dapeng.jackson.serializer.JKPercentFormatSerializer;
import com.fasterxml.jackson.annotation.JacksonAnnotationsInside;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

/**
 * @BelongProject study
 * @BelongPackage com.dapeng.jackson.annotations
 * @Description TODO
 * @ClassName JKPercentFormat
 * @Author xupenghong
 * @Date 2024/9/13 16:05
 * @Version 1.0.0
 */
@Target(ElementType.FIELD)
@Retention(RetentionPolicy.RUNTIME)
@JsonSerialize(using = JKPercentFormatSerializer.class)
@JacksonAnnotationsInside
public @interface JKPercentFormat {

    /**
     * 保留小数位数
     */
    int scale() default 2;

    /**
     * 单位符号
     */
    boolean withSymbol() default false;
}